package cn.holy.app.xcddt.ui.activity.setting

import androidx.core.content.ContextCompat
import cn.holy.app.xcddt.R
import cn.holy.app.xcddt.app.App
import cn.holy.app.xcddt.repository.UserRepository
import cn.holy.app.xcddt.ui.activity.base.BaseActivity
import com.alibaba.android.arouter.facade.annotation.Route
import com.alibaba.android.arouter.launcher.ARouter
import com.qmuiteam.qmui.util.QMUIStatusBarHelper
import com.qmuiteam.qmui.widget.grouplist.QMUICommonListItemView
import com.qmuiteam.qmui.widget.grouplist.QMUIGroupListView
import kotlinx.android.synthetic.main.activtiy_setting.*
import java.security.AccessController.getContext
import javax.inject.Inject


/**
 * Created by 69568 on 2018/3/5.
 */
@Route(path = "/app/setting")
class SettingActivity : BaseActivity() {
    @Inject
    lateinit var userRepo: UserRepository

    override fun initData() {
    }

    override fun initView() {

        App.appComponent.inject(this)
        QMUIStatusBarHelper.translucent(this)
        QMUIStatusBarHelper.setStatusBarDarkMode(this)
        top_bar.setTitle("设置").setTextColor(ContextCompat.getColor(this, R.color.colorWhite))
        top_bar.addLeftImageButton(R.mipmap.ic_back, R.id.action_close).setOnClickListener({ finish() })
        val normalItem = groupListView.createItemView("上报手机")
        normalItem.accessoryType = QMUICommonListItemView.ACCESSORY_TYPE_CHEVRON

        val normalItem2 = groupListView.createItemView("巡查名单")
        normalItem.accessoryType = QMUICommonListItemView.ACCESSORY_TYPE_CHEVRON




        QMUIGroupListView.newSection(this)
                .setTitle("基本信息")

                .addItemView(normalItem, {
                    ARouter.getInstance().build("/app/setting/bind").navigation()
                })
                .addItemView(normalItem2, {
                    ARouter.getInstance().build("/app/setting/username").navigation()
                })
                .addTo(groupListView)

    }

    override fun initLayout() {
        setContentView(R.layout.activtiy_setting)
    }

}